import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCmsModelsController } from '../../../controllers';
const uctoocmsModelsRouter = new Router();
const cmsModelsController = new uctooCmsModelsController();

uctoocmsModelsRouter.post('/add', requireUser, cmsModelsController.add);
uctoocmsModelsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/cms_models'), cmsModelsController.edit);
uctoocmsModelsRouter.post('/del', requireUser, rowLevelPermission('uctoo/cms_models'), cmsModelsController.delete);

//For getting cmsModels with permission control
uctoocmsModelsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/cms_models'), cmsModelsController.getSingle);
uctoocmsModelsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/cms_models'), cmsModelsController.getMany);
uctoocmsModelsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/cms_models'), cmsModelsController.getMany);

//#endregion AutoCreateCode
export default uctoocmsModelsRouter;
